package com.millstein.context;

import com.millstein.model.LoginUser;

/**
 * @description:
 * @author: tsing
 * @create: 2021-09-13 20:01
 */
public class UserAuthorization {
    private static final ThreadLocal<LoginUser> userContext = new ThreadLocal<>();

    public static void setUserContext(LoginUser loginUser) {
        userContext.set(loginUser);
    }

    public static LoginUser getUserContext() {
        return userContext.get();
    }

    public static void removeUserContext() {
        userContext.remove();
    }
}
